<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title >直播间样品管理</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;">
    <style type="text/css">
        .update {
            display: inline-block;
            margin-left: 15px;
            padding: 0 20px;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            background: #009789;
            color: #fff;
            text-align: center;
            border-radius: 3px;
            cursor: pointer;
        }

        .update i {
            display: inline-block;
            margin-right: 10px;
            vertical-align: middle;
            width: 30px;
            height: 30px;
            background: url();
        }
        .T-box {
            width: 400px;
            padding: 0 20px;
            text-align: left;
        }

        .T-box p {
            position: relative;
            height: 36px;
            line-height: 36px;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .T-box p span {
            display: inline-block;
            padding-right: 15px;
            text-align: right;
            width: 110px;
            line-height: 36px;
            font-size: 14px;
        }

        .T-box p input, .T-box p select {
            width: 250px;
            padding: 0 5px;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            border: 1px solid #d3d3d3;
            outline: none;
        }

        .T-box p i {
            padding: 0 10px;
            line-height: 36px;
            font-style: normal;
        }

        .T-box p b {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
            width: 60px;
            height: 36px;
            line-height: 36px;
            background: #c33;
            color: #fff;
            text-align: center;
            font-size: 13px;
            font-weight: normal;
        }
    </style>
    <div class="layui-tab layui-tab-brief" lay-filter="demo">
        <ul class="layui-tab-title">

            <li > <a href="/zbj/live_data_list">直播间数据管理</a></li>
            <li> <a href="/zbj/sales_statistics_douyin">直播间销售统计</a></li>
            <li> <a href="/report/goods_sales_analyse">商品动销分析</a></li>
            <li> <a href="/report/goods_category_analyse">商品类目动销分析</a></li>
            <li class="layui-this"> <a href="/zbj/sample_list">直播间样品管理</a></li>
        </ul>
    </div>

    <!-- content starts -->
<!--    <blockquote class="layui-elem-quote">订单总览</blockquote>-->

    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
<!--            <div class="layui-inline">-->
<!--                <form method="post" enctype="multipart/form-data" id="execl_form">-->
<!--                    <input type="file" name="excel" id="excel" placeholder="" class="layui-input">-->
<!--                </form>-->
<!--            </div>-->

<!--            <div class="layui-inline">-->
<!--                <button type="button" id="excel_upload_btn" class="layui-btn">上传excel</button>-->
<!--                <span id="excel_upload_btn_" style="display: none;" class="update"><i></i>导入中</span>-->
<!--            </div>-->
            <form class="layui-form layui-form-pane1" method="get" action="/zbj/sample_list">

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <input type="text" name="goodsNum" th:value="${goodsNum}" placeholder="SKU编码" style="width: 200px;" class="layui-input">
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">拿样日期</label>
                        <div class="layui-input-inline">
                            <input type="text"   class="layui-input" name="orderDate" th:value="${orderDate}" id="orderDate" autocomplete="off"
                                  style="width: 160px;" placeholder="yyyy-MM-dd">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="zbjId" id="zbjId">
                                <option value="">直播间</option>
                                <option th:each="item:${zbj}" th:value="${item.getId()}" th:text="${item.getName()}">zbj</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button type="submit" class="layui-btn layui-btn-normal">搜索</button>
                        <i>总共：<span style="color: red" th:text="${totalSize}"></span>条记录</i>
                    </div>
                </div>
                <div class="layui-form-item">


                    <div class="layui-inline">
                        <button type="button" lass="button" id="print_btn" class="layui-btn layui-btn-primary">打印页面</button>
                    </div>
                    <div class="layui-inline">
<!--                        <a  href="/zbj/excel_sample_import">excel下样品单</a>-->
                        <button type="button" lass="button" id="export_btn" class="layui-btn layui-btn-primary">导出</button>
                    </div>
                </div>


            </form>
        </div>
    </fieldset>

    <!-- start dd-wrapper -->
    <link rel="stylesheet" href="/goods/order.css"/>
    <div class="dd-wrapper">
        <table class="dd-table">
            <tr>
                <th>序号</th>
                <th>拿样日期</th>
                <th width="20%">商品</th>
                <th>SKU信息</th>
                <th>库存数量</th>
                <th width="100px">尺寸</th>
                <th >面料</th>
                <th >重量</th>
                <th >季节</th>
                <th >年份</th>
                <th >建议</th>
                <th >采购价</th>
                <th >建议直播价</th>
                <th>直播间</th>
                <th>商品状态</th>
                <th>订单号</th>
                <th>样品状态</th>
                <th></th>
            </tr>
            <tr th:each="item:${lists}">
                <td th:text="${itemStat.index +1 }"></td>
                <td th:text="${item.orderDate}"></td>
                <td>
                    <div ><img th:src="${item.getGoodsImage()}">
                        <p>
                            <span  th:text="${#strings.abbreviate(item.getGoodsTitle(),18)}"></span>
                        </p>
                    </div>
                </td>
                <td>
                    <p th:text="${item.skuInfo}"></p><br/>
                    <p th:text="${item.specNumber}"></p>
                </td>
                <td th:text="${item.currentQty}"></td>
                <td >
                    <li th:if="${item.length >0}">衣长：<span>[[${item.length}]]</span>cm</li>
                    <li th:if="${item.height >0}">袖长：<span>[[${item.height}]]</span>cm</li>
                    <li th:if="${item.width >0}">胸阔：<span>[[${item.width}]]</span>cm</li>
                    <li th:if="${item.width1 >0}">肩阔：<span>[[${item.width1}]]</span>cm</li>
                    <li th:if="${item.width2 >0}">腰阔：<span>[[${item.width2}]]</span>cm</li>
                    <li th:if="${item.width3 >0}">臀阔：<span>[[${item.width3}]]</span>cm</li>

                </td>
                <td th:text="${item.attr5}"></td>
                <td><span th:text="${#numbers.formatDecimal(item.weight,0,0)}"></span>g</td>
                <td><span th:text="${item.attr1}"></span></td>
                <td><span th:text="${item.attr4}"></span></td>
                <td><span th:text="${item.remark}"></span></td>
                <td><span th:text="${'￥'+item.costPrice}"></span></td>
                <td><span th:text="${item.salePrice}"></span></td>
                <td><span th:text="${item.buyerName}"></span></td>
                <td>
                    <span th:if="${item.goodsStatus == 1}">销售中</span>
                    <span th:if="${item.goodsStatus == 2}">已下架</span>
                </td>
                <td><span th:text="${item.orderNum}"></span></td>
                <td>
                    <span th:if="${item.itemStatus == 0}">仓库未发货</span>
                    <span th:if="${item.itemStatus == 1}">仓库已发货</span>
                    <span th:if="${item.itemStatus == 2}">样品已退回</span>
                </td>

                <td>
                    <a class="layui-btn layui-btn-xs layui-btn-normal remark_refund" th:if="${item.itemStatus == 1}" th:href="@{/erp_sales/refundApply(id=${item.orderId},shopId=99,itemId=${item.itemId})}" style="color: #fff" >退样品</a>
                </td>
            </tr>
        </table>
    </div>
    <!-- end dd-wrapper -->
    <div class="layui-box layui-laypage layui-laypage-default pageBox">
        <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
    </div>

    <script type="text/javascript" src="/goods/Tips/Tips.min.js"></script>
    <script type="text/javascript">
        var layer;
        var $;
        var windowOpen;
        layui.use(['laydate', 'jquery', 'form', 'layer'], function () {
            var laydate = layui.laydate;
            $ = layui.jquery;
            var form = layui.form;
            layer = layui.layer;
            laydate.render({
                elem: '#orderDate'
                ,type: 'date'
            });

            $(function () {
                var zbjId = '[[${zbjId}]]';
                $("#zbjId").val(zbjId);
                form.render(); //更新全部
                form.render('select'); //刷新select选择框渲染
            })

            $("#print_btn").click(function () {
                layer.open({
                    type: 2,
                    title: '打印样品清单',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['1200px', '90%'],
                    content: '/zbj/sample_list?isPrint=1' //iframe的url
                });
            })


            $("#export_btn").click(function () {
                var orderDate = $("#orderDate").val();
                var zbjId = $("#zbjId").val();
                window.location.href='/zbj/sample_list_export?orderDate='+orderDate+"&zbjId="+zbjId;
            })
        });

    </script>

</div>
</body>
<html>
